package com.example.biz.impl;

import com.example.biz.IUserBiz;
import com.example.dao.IUserDao;
import com.example.entity.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 01182800 on 2017/2/24.
 */
@Service
@Transactional
public class UserBiz implements IUserBiz {

    @Resource
    private IUserDao userDao;

    @Override
    public List<User> findAll() {
        return this.userDao.findAll();
    }

    @Override
    public User getById(Integer id) {
        return this.userDao.getById(id);
    }

    @Override
    public void save(User user) {
        this.userDao.save(user);
    }

    @Override
    public void update(User user) {
        this.userDao.update(user);
    }

    @Override
    public void delete(Integer id) {
        this.userDao.delete(id);
    }
}
